package com.sun.temp.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sun.temp.bean.FilePath;
import com.sun.temp.common.result.Result;
import com.sun.temp.mapper.mapper1.FilePathDao;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

@RestController
public class FilePathController {

    @Resource
    private FilePathDao filePathDao;

    /**
     * 获取文件路径
     */
    @GetMapping("/getFilePath")
    public Result getFilePath() {
        return Result.success(filePathDao.selectList(new QueryWrapper<FilePath>().eq("type",2)));
    }

    /**
     * 修改文件路径
     */
    @PostMapping("/updateFilePath")
    public Result updateFilePath(@RequestBody FilePath path){
        return Result.success(filePathDao.updateById(path));
    }

}